{template 'header'}

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">任务审核</a>
        <a>
          <cite>已抢任务</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
            <input type="text" name="userinfo" value="{$userinfo}" placeholder="手机号/真实姓名" autocomplete="off"
                   class="layui-input">
            <input type="text" name="title" value="{$title}" placeholder="任务标题" autocomplete="off" class="layui-input">
            <input class="layui-input" placeholder="接取开始时间" name="start_time" id="start_time"
                   value="{$_GPC['start_time']}">
            <input class="layui-input" placeholder="接取结束时间" name="end_time" id="end_time" value="{$_GPC['end_time']}">
            <div class="layui-input-inline">
                <select name="receive_status">
                    <option value="" {if strlen($receive_status)==0}selected{/if}>任务接取状态</option>
                    <option value="0" {if strlen($receive_status)==1 && $receive_status==0}selected{/if}>进行中</option>
                    <option value="1" {if $receive_status==1}selected{/if}>已失效</option>
                    <option value="2" {if $receive_status==2}selected{/if}>待审核</option>
                    <option value="3" {if $receive_status==3}selected{/if}>已完成</option>
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="review_status">
                    <option value="" {if strlen($review_status)==0}selected{/if}>审核状态</option>
                    <option value="0" {if strlen($review_status)==1 && $review_status==0}selected{/if}>待审核</option>
                    <option value="1" {if $review_status==1}selected{/if}>通过</option>
                    <option value="2" {if $review_status==2}selected{/if}>已驳回</option>
                </select>
            </div>
            <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            <span class="x-right" style="line-height:40px">共有数据：{$total} 条</span>
        </form>
    </div>
    <table class="layui-table">
        <thead>
        <tr>
            <th>编号</th>
            <th>接收人</th>
            <th>任务标题</th>
            <th>任务金额</th>
            <th>接收时间</th>
            <th>接受状态</th>
            <th>审核状态</th>
            <th>审核时间</th>
            <th>审核备注</th>
        </tr>
        </thead>
        <tbody>
        {if $total==0}

        <tr>
            <td colspan="11" style="text-align: center;">暂无数据</td>
        </tr>

        {else}
        {loop $list $item}
        <tr>
            <td>{$item['id']}</td>
            <td>{if !empty($item['truename'])}{$item['truename']}:{/if}用户ID:{$item['user_id']}<br>手机号:{$item['mobile']}</td>
            <td>任务ID:{$item['taskid']}<br>任务标题:{$item['title']}</td>
            <td>{$item['task_money']}</td>
            <td>{php echo date('Y-m-d H:i:s',$item['receive_time'])}</td>
            <td>
                {if $item['receive_status']==0}进行中
                {elseif $item['receive_status']==1}已失效
                {elseif $item['receive_status']==2}待审核
                {elseif $item['receive_status']==3}已审核
                {else}未知状态
                {/if}
            </td>
            <td>
                {if $item['receive_status']==2 && $item['review_status']==0}待审核
                {elseif $item['review_status']==1}已通过
                {elseif $item['review_status']==2}已驳回
                {else}任务未完成
                {/if}
            </td>
            <td>{if $item['receive_status']==3}{php echo date('Y-m-d H:i:s',$item['handle_time'])}{else}任务未完成{/if}</td>
            <td>{$item['review_mark']}</td>
        </tr>
        {/loop}
        {/if}
        </tbody>
    </table>
    <div class="page">
        {$pager}
    </div>

</div>
<script>
    layui.use('form', function () {
        var form = layui.form;

        //监听提交
        form.on('submit(sreach)', function (data) {
            console.log(data.field)
            var str = '';
            for (var key in data.field) {
                str += key + "=" + data.field[key] + "&";
            }
            var url = '{php echo $this->createWebUrl("task_receive_list")}'
            location.href = url + "&" + str;
            return false;
        });
    });
    layui.use('laydate', function () {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start_time', //指定元素
            type: 'datetime'
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end_time', //指定元素
            type: 'datetime'
        });
    });
</script>
<script>var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>

</html>